{layout name="public/layout" /}
{include file='yxnavbar'}



{include file='../../plugin/shopplan/template/web/shopplan_common_nav'}
{if $system['is_shop_plan']==1}

<script type="text/javascript">
function changeStore(){
    // var form = document.getElementById("form1");
    // form.submit();
    var themeid = $('#themeid option:selected').val();
	var postUrl = "{php echo createWebUrlPlugin('shopplan',array('themeid'=>$themeid));}";
        postUrl+='&themeid='+themeid;

    window.location.href = postUrl;
}
</script>
<form id="form1" class="form form-horizontal" action="{php echo createWebUrlPlugin('shopplan',array('id'=>$id,'themeid'=>$themeid,'storeid'=>$storeid));}" enctype ="multipart/form-data" method="post"> 

<div class="main">
	<div class="panel panel-default" role="tabpanel" style="">
		<div class="panel-heading">基础设置
                    {if count($themelist)>1 }
                    <div class="col-xs-12 col-sm-2 col-md-2" style="float: right;margin-top: -7px">
                        <select onchange="changeStore();" class="form-control" name="themeid" id="themeid">
                            {loop $themelist $row}
                            <option value="{$row['id']}" {if $themeid == $row['id'] }selected="selected"{/if}>{$row['id']} - {php echo mb_substr($row['title'],0,8,'utf-8');}</option>
                            {/loop}
                        </select>
                    </div>
                    {else}
                    <input type="hidden" name="themeid" value="{$themeid}" />
                    {/if}



            </div>
			<div class="panel-body" style="">
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">立即预约</label>
							<div class="col-sm-8 col-xs-12">
								<input type="text" class="form-control"  placeholder="" name="plantext"  value="{if $item['plantext']}{$item['plantext']}{else}立即预约{/if}">
								<span class="help-block">按钮文字,默认为[立即预约],可以任意修改,如改成[马上预约]</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">查看预约</label>
							<div class="col-sm-8 col-xs-12">
								<input type="text" class="form-control"  placeholder="" name="planedtext"  value="{if $item['planedtext']}{$item['planedtext']}{else}立即预约{/if}">
								<span class="help-block">按钮文字,默认为[查看预约],可以任意修改,如改成[预约查看]</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">年龄限制</label>
							<div class="col-sm-8 col-xs-12">
								<label class="radio-inline"><input type="radio" name="agelimit"  value="1" {if $item['agelimit']==1}checked="checked"{/if}>开启</label>
								<label class="radio-inline"><input type="radio" name="agelimit"  value="0" {if $item['agelimit']==0}checked="checked"{/if}>关闭</label>
								<span class="help-block">年龄限制，开启后，某时间段可设置仅限某年龄段预约</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">预约有效期</label>
							<div class="col-sm-8 col-xs-12">
								{php $item['start_date']<$theme['begintime']?($item['start_date']=$theme['begintime']).($item['end_date']=$theme['endtime']):"";}
								{php echo view_form_field_daterange('shopplan_date', array('start'=>date('Y-m-d H:i:s',$item['start_date']),'end'=>date('Y-m-d H:i:s',$item['end_date'])), true);}
<!--								<label class="radio-inline" >{php echo view_form_field_date('end_date',$item['end_date']);}</label>-->
								<span class="help-block">此日期范围内，客户可预约</span>
							</div>
						</div>
	</div></div></div>
	<div class="panel panel-default" role="tabpanel" style="">
		<div class="panel-heading">客户修改限制</div>
			<div class="panel-body" style="">
				<div class="form-group">
					<label class="col-sm-2 col-xs-12 control-label">最长可改时间</label>
					<div class="col-sm-8 col-xs-12">
						<div class="input-group">
							<input type="number" class="form-control"  placeholder="" name="enable_days"  value="{if $item['enable_days']}{$item['enable_days']}{else}7{/if}">
							<span class="input-group-addon">天</span>
						</div>
						<span class="help-block">预约之后,最长多少天内可以修改,默认7天</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 col-xs-12 control-label">最晚修改日期</label>
					<div class="col-sm-8 col-xs-12">
						<div class="input-group">
							<input type="number" class="form-control"  placeholder="" name="days_away"  value="{if $item['days_away']}{$item['days_away']}{else}3{/if}">
							<span class="input-group-addon">天</span>
						</div>
						<span class="help-block">距离预约的日期,最晚多少天之外可以修改,默认3天</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 col-xs-12 control-label">最大修改次数</label>
					<div class="col-sm-8 col-xs-12">
						<div class="input-group">
							<input type="number" class="form-control"  placeholder="" name="max_edit_nums"  value="{if $item['max_edit_nums']===null}5{else}{$item['max_edit_nums']}{/if}">
							<span class="input-group-addon">次</span>
						</div>
						<span class="help-block">客户最多可修改的次数,默认5次</span>
					</div>
				</div>
										
	</div></div>
	

</div>


<input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-2">
</form>	
{/if} 

